package com.hmy.cornpestdet.controller;

import com.hmy.cornpestdet.service.AdminUploadInfoService;
import com.hmy.cornpestdet.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin")
public class AdminUploadInfoController {
    @Autowired
    private AdminUploadInfoService adminUploadInfoService;

    @GetMapping("/getAllUploadInfo")
    public Result getAllUploadInfo() {
        return adminUploadInfoService.getAllUploadInfo();
    }

    @GetMapping("/getCurrentPageUploadInfo")
    public Result getCurrentPageUploadInfo(@RequestParam int currentPage, @RequestParam int pageSize) {
        return adminUploadInfoService.getCurrentPageUploadInfo(currentPage, pageSize);
    }

    @PostMapping("/deleteUploadInfoByImageName")
    public Result deleteUploadInfoByImageName(@RequestParam String imageName) {
        return adminUploadInfoService.deleteUploadInfoByImageName(imageName);
    }

}
